import React,{Component} from 'react';
import SingerSort from './Sort';
import SingerContent from './Content';

class Singer extends Component {

   
    state={
        sort:'',
        cat:0
    }
    getSortMsg = (data) =>{
        // console.log('子组件传递到父组件的字母数据：',data);
        this.setState({
            sort:data,
            // cat:data
        })
    }
    getLettersMsg = (data) =>{
        // console.log('子组件传递到父组件的歌手分类数据：',data);
        this.setState({
            // sort:data,
            cat:data
        })
    }

        render(){
            console.log('父组件中的数据',this.state);
            return (
                <div>
                    <SingerSort getSort = {this.getSortMsg} getLetters = {this.getLettersMsg}/>
                    <SingerContent sort={this.state.sort} cat = {this.state.cat}/>

                </div>
            );
        }
    
}

export default Singer;